﻿--[[
   @brief    ui logic for main window menue
   @author   rickonzhang
   @version  1.0
   @date     2015-03-12
--]]

main_menue_desc =
{
    module_name = 'main_menue',
    events = 
    {
        {
            c_event = 
            {
                {
                    id  = ierd_tgp.upd_loader.kOnPreUpdateDetected, --升级检查完成
                    callback = "main_menue_control.on_preupdate_detected"
                },
                {
                    id  = ierd_tgp.tpf_ui.TPF_UI_EXIT_TGP, --托盘调用退出tgp
                    callback = "main_menue_control.exit_tgp"
                },
                --{
                --    id  = ierd_tgp.rail_proxy.SYNC_PROFILE_END, --云存档同步完成
                --    callback = "main_menue_control.on_sync_profile_end"
                --}
            },
            lua_event = 
            {
                {        
                    id  = main_menue_event.MAIN_MENUE_OPEN_MENUE,  
                    callback = "main_menue_control.open_main_menue"
                },
                {
                    id  = main_menue_event.MAIN_MENUE_SITCH_USER,  
                    callback = "main_menue_control.switch_user"
                },
                {
                    id  = main_menue_event.MAIN_MENUE_SITCH_OFFLINE,  
                    callback = "main_menue_control.switch_offline_mode"
                },
                {
                    id  = main_menue_event.MAIN_MENUE_EXIT_TGP,  
                    callback = "main_menue_control.exit_tgp"
                },
                {
                    id = main_menue_event.MAIN_MENUE_WILL_EXIT_TGP,
                    callback = "main_menue_control.will_exit_app"
                },
                {
                    id = webgame_browser_event.ON_GAME_START,
                    callback =  "main_menue_control.on_webgame_browser_game_start"
                },
                {
                    id = webgame_browser_event.ON_GAME_END,
                    callback =  "main_menue_control.on_webgame_browser_game_end"
                },
            },
            lua_file = "main_menue\\control.lua"
        }
    }
};
desc_mgr.add(main_menue_desc);
ierd_tgp.tpf_ui.Require("main_menue\\control.lua");